package com.example.demo.repository;

import com.example.demo.entity.Customer;
import com.example.demo.entity.Memorandum;
import com.example.demo.entity.Status;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.Date;
import java.util.List;

public interface MemorandumRepository extends JpaRepository<Memorandum,Integer>,JpaSpecificationExecutor<Memorandum> {

    @Query(value = "select count(*) from memorandum where memorandum_status = 9 and updater = ?1",nativeQuery=true)
    Integer unDoneCount(Integer id);

    @Query(value ="select * from memorandum s where s.memorandum_start BETWEEN ?1 and ?2",nativeQuery=true)
    List<Memorandum> findByMemorandumStart(String date1,String date2);
}
